import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		name: 'Home',
		meta: { index: 0, title: '首页', needLogin: false },
		component: Home
	},
	{
		path: '/booktype',
		name: 'Booktype',
		meta: { index: 1, title: '分类' },
		component: () => import('../views/Booktype.vue')
	},
	{
		path: '/bookrack',
		name: 'Bookrack',
		meta: { index: 2, title: '书架' },
		component: () => import('../views/Bookrack.vue')
	},
	{
		path: '/person', 
		name: 'Person',
		meta: { index: 3, title: '我的' },
		component: () => import('../views/Person.vue'),
	},
	{
		path: '/login',
		name: 'Login',
		component: () => import('../views/account/Login.vue'),
	},
	{
		path: '/signup',
		name: 'Signup',
		component: () => import('../views/account/SignUp.vue'),
	},
	{
		path: '/booklist',
		name: 'Booklist',
		component: () => import('../views/book/BookList.vue'),
	},
	{
		path: '/bookinfo',
		name: 'Bookinfo',
		component: () => import('../views/book/BookInfo.vue'),
	},
	{
		path: '/search',
		name: 'Search',
		component: () => import('../views/book/Search.vue')
	},
	{
		path: '/bookcomments',
		name: 'BookComments',
		component: () => import('../views/book/BookComments.vue')
	},
	{
		path: '/chapterlist',
		name: 'ChapterList',
		component: () => import('../views/book/ChapterList.vue')
	}
]

const router = new VueRouter({
	routes
})

export default router
